#ifndef REGGRAMMATICA_H_
#define REGGRAMMATICA_H_

#include <iostream>
#include <ostream>
#include <set>
#include <string>
#include <iterator>
#include "ProductionRule.h"

using namespace std;
static const char EPS = '\0';
namespace regulargrammatica { 

template<class DataType>
class RegGrammatica
{
public:
	RegGrammatica();
	RegGrammatica(set<DataType> helpSymbols, set<char> alphabet, set<ProductionRule <DataType> > productionRules, DataType startSymbol);
	static void prodLine(ostream &os, const set<ProductionRule<DataType> >& allRules);
	virtual ~RegGrammatica();
	set<DataType> getLanguage(int maxSeps);
	string toString(const RegGrammatica<DataType> &regGram);
private:
	set<DataType> N;					//Hulpsymbolen
	set<char> sigma;					//Letter Sigma
	set<ProductionRule<DataType> > P;	//Productionrules
	DataType S;							//Start Symbol
	
	void generateWords(unsigned int maxSize, const DataType & currentNonTerm, const string &word, set<DataType> &language);
	
	
	friend ostream& operator<<(ostream &os, const RegGrammatica<DataType> &regGram)
	{
		os << "De Productieregels: "<<endl;
		prodLine(os, regGram.P);
	return os;
	}
};

#include "regGrammatica.cpp"
}
ostream& operator <<(ostream &os, const set<string> &exp);
#endif

